﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Pages/Master/List.Master" AutoEventWireup="true"
    CodeBehind="UserList.aspx.cs" Inherits="DevFx.Web.Pages.Rights.UserList" %>

<%@ Register src="../../Controls/Common/Pager.ascx" tagname="Pager" tagprefix="uc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolderHeader" runat="server">
    <script type="text/javascript">
        $(document).ready(function () {
            gridview("<%=gvList.ClientID %>");
            $("#<%=gvList.ClientID %>").mouseover(function () {
                $(this).css("cursor", "hand");
            });
        });
        $("input:submit").button();
        function show(id, flag) {
            return showWin("UserEdit.aspx?time=" + new Date() + "&&id=" + id + "&&flag=" + flag, 600, 350);
          }
          function showRole(id, flag) {
              showWin("UserRole.aspx?time=" + new Date() + "&&id=" + id + "&&flag=" + flag, 600, 350);
               return false;
          }
  
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="top">
        <asp:Button runat="server" ID="btnadd" CssClass="button2" Text=" 添 加 " 
            OnClientClick="return show('','1');" onclick="btnadd_Click" />
        <asp:Button runat="server" ID="btndel" Text=" 禁 用 " CssClass="button2" OnClick="btndel_Click"
            OnClientClick='return DisabledCount("<%=gvList.ClientID %>");' />
        <asp:Button runat="server" ID="btnEnabld" Text=" 启 用 " CssClass="button2" OnClick="btnEnabld_Click"
            OnClientClick='return abledCount("<%=gvList.ClientID %>");' />
    </div>
    <asp:GridView ID="gvList" runat="server" AutoGenerateColumns="False" CssClass="gv"
        AllowSorting="True" BorderStyle="None" OnSorting="gvList_Sorting" 
        onrowcommand="gvList_RowCommand">
        <Columns>
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:CheckBox ID="cbx1" runat="server" />
                </ItemTemplate>
                <HeaderTemplate>
                    <asp:CheckBox ID="cbx1" runat="server" />
                </HeaderTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="UserName" HeaderText="人员名称" SortExpression="UserName" />
            <asp:BoundField DataField="Email" HeaderText="邮箱" SortExpression="Email" />
            <asp:TemplateField HeaderText="状态" SortExpression="Disabled">
                <ItemTemplate>
                    <%#Eval("Disabled").ToString().ToLower()=="true"?"禁用":"启用"%>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="">
                <ItemTemplate>
                     <img  src="../../Contents/images/edit.gif" height="13" width="13" alt="edit"/>
                    <asp:LinkButton runat="server" ID="btnlink" OnClientClick='<%# " return show(\"" + Eval("UserID").ToString() + "\",2);" %>' CommandName="editing"
                        Text="编辑"></asp:LinkButton>
                    <asp:LinkButton runat="server" ID="btnRoleEdit" OnClientClick='<%# " return showRole(\"" + Eval("UserID").ToString() + "\",2);" %>' CommandName="role"
                        Text="角色维护"></asp:LinkButton>
                    <asp:HiddenField runat="server" ID="hfID" Value='<%#Eval("UserID") %>' />
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    <uc1:Pager ID="Pager1" runat="server" />
</asp:Content>
